package com.hongawen.lambda;

/**
 * @author hongawen
 * @version 1.0.0
 * @createTime 2021年04月25日 19:53
 */
public class Lambda {
    //抽象功能接口
    interface Printer {
        void print(String something);
    }

    //通过参数传递功能接口
    public void printSomething(String something, Printer printer) {
        printer.print(something);
    }

    public static void main(String[] args) {
        Lambda lambda = new Lambda();
        String something = "hong a wen ni guo lai a !";
        lambda.printSomething(something,thing-> System.out.println(thing));
        //或者
        lambda.printSomething(something,System.out::println);
    }
}
